package com.googlecode.jvmpart;

import java.util.Map;

import com.googlecode.jvmpart.proc.JvmProcessException;

/**
 * Creating input parameters for a partitioned
 * jvm process in the form of {@link Map} instances. The usual aim is to
 * create a set of distinct input values, e.g. a set of non-overlapping primary
 * key ranges, or a set of unique filenames.
 * 
 * @author chunzhan.he
 *
 */
public interface Partitioner {
	/**
	 * Create a set of distinct parameters {@link Map} instances together with
	 * a unique identifier for each one. The identifiers should be short,
	 * mnemonic values that will be used as the monitor thread name of a partitioned jvm process, 
	 * and only have to be unique within the return value (e.g. use an incrementer).
	 * @param capacity the size of the parallel jvm processes
	 * @return a set of parameters for jvm process partition
	 * the size of the set is the total size of the jvm processes
	 */
	public Map<String, Map<String, Object>> partition(int capacity) throws JvmProcessException;
}
